
const home = r => require.ensure([], () => r(require('./views/Home')), 'home')
const login = r => require.ensure([], () => r(require('./views/Login')), 'login')
const err = r => require.ensure([], () => r(require('./views/404')), 'err')
const department = r => require.ensure([], () => r(require('./views/department/department')), 'department')
const personnel = r => require.ensure([], () => r(require('./views/personnel/personnel')), 'personnel')
const station = r => require.ensure([], () => r(require('./views/station/station')), 'station')

let routes = [
    {
        path: '/',
        component: home,
        name: '',
        hidden: true,
        meta:{
          requireAuth:true,
        },
        children:[
           {
           	path:'/department',
           	component:department
           },

           {
           	path:'/personnel',
           	component:personnel
           },

           {
           	path:'/station',
           	component:station
           },

        ]
    },
    {
    	path:'/login',
    	component:login,
    	name:'login'
    },
    {
    	path:'/404',
    	component:err,
    	name:'404',
    	hidden:true
    },
    {
        path: '*',
        hidden: true,
        redirect: { path: '/404' }
    }
];

export default routes;